<!doctype html>
<html lang="en">
<head>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{asset('/css/web/user/hehuoren.css')}}">
    <link rel="stylesheet" href="{{asset('/css/web/user/member.css')}}">
</head>
<body>
@include('web.layout.header')
@include('web.layout.user_tab')
<div class="base_member_content">
    <div class="w1200">
        @include('web.layout.seller_nav') 
        <div class="nav_right flr" style="background: #fff;">
            <div class="ttitle">
                <div class="yjleft">员工管理</div>
            </div>
            <div class="add_member">
                <p class="add_name">商铺用户添加自己的员工</p>
                @inject('menuPresenter','App\Presenters\MenuPresenter')
               {!! $menuPresenter->renderWebOperation(12,'btnInvite') !!}
{{--                <a href="{{url('/seller/member_add')}}" class="add_num"> +  邀请员工</a>--}}
            </div>
            <ul class="title" style="margin-top: 20px;">
                <li style="width: 238px;">姓名</li>
                <li style="width: 240px;">手机号</li>
                <li style="width: 240px;">权限</li>
                <li style="width: 240px;">操作</li>
            </ul>
            <ul class="title01" style="border: 1px solid #e5e5e5;border-top: 0;">
                @foreach($list as $k=>$v)
                <li style="width: 238px;">{{$v['user_nick']}}</li>
                <li style="width: 240px;">{{$v['user_phone']}}</li>
                <li style="width: 240px;">商品管理,添加商品</li>
                <li style="width: 240px;">
                    @inject('menuPresenter','App\Presenters\MenuPresenter')
                   @if($menuPresenter->renderWebOperation(12,'btnEdit'))
                    <a href="{{url('/member/seller/member/'.$v['id'])}}" class="edit">
                        {!! $menuPresenter->renderWebOperation(12,'btnEdit') !!}
                    </a>
                    |
                    @endif
                    @if($menuPresenter->renderWebOperation(12,'btnDisRelation'))
                    <a href="javascript:void(0)" data-id="{{$v['id']}}" data-name="{{$v['user_nick']}}" class="del" >
                        {!! $menuPresenter->renderWebOperation(12,'btnDisRelation') !!}
                    </a>
                    @endif
                </li>
                @endforeach
            </ul>
            <div class="page">
                
            </div>          
        </div>
    </div>
</div>
@include('web.layout.footer')
<script type="text/javascript">
    $(function(){
        $('.del').click(function(){

            var id = $(this).attr('data-id');
            var name = $(this).attr('data-name');
            layer.confirm('', {
                title :'解除员工',
                content: '<div style="text-align: center;">确定要与 [ '+name+' ] 解除关系？<br> 解除关系后，该账号仍可在[e井在线]上做为普通会员正常使用，但不能再代表本公司进行任何经营行为。</div>',
                btn: ['确认', '取消'] //可以无限个按钮
            }, function (index) {
                $.ajax({
                    url: "{{url('/member/seller/member')}}/"+id,
                    type: 'delete',
                    dataType: 'json',
                    data: {'id': id},
                    success: function (data) {
                        if (0 == data.code) {
                            layer.alert(data.message, {
                                icon: 1
                            }, function () {
                                location.reload();
                            });
                        } else {
                            layer.alert(data.message, {
                                icon: 2
                            });
                        }
                    }
                });
            }, function (index, layero) {
                layer.close(index);
            });
        })
    })
     

</script>
</body>
</html>